Skip to content

feat(tools): get_version_range — NVD CPE + OSV.dev affected version range resolver + CLI subcommand (+99 tests) - #54

Open
manus-use wants to merge 1 commit into
mainfrom
feat/version-range
Open

feat(tools): get_version_range — NVD CPE + OSV.dev affected version range resolver + CLI subcommand (+99 tests)#54
manus-use wants to merge 1 commit into
mainfrom
feat/version-range

Conversation

@manus-use

@manus-use manus-use commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the get_version_range tool and manus-agent version-range CLI subcommand — a README-documented feature that was completely unimplemented (no tool file, no CLI dispatch, no tests).

What it does

Computes affected version ranges for a CVE by walking two complementary sources:

  1. NVD CPE configurations — parses versionStartIncluding, versionEndExcluding, versionEndIncluding bounds from CPE Match criteria to produce vendor/product-level version constraints
  2. OSV.dev affected ranges — fetches per-package introduced/fixed/last_affected events from ecosystem databases (PyPI, npm, Maven, Go, RustSec, etc.)

Merges both sources, deduplicates, and optionally filters by ecosystem. Output includes:

  • Affected version ranges (human-readable + structured)
  • First patched version (from OSV fixed events or NVD end-excluding bounds)
  • Affected package names and ecosystems
  • CVSS context from NVD

CLI Usage

manus-agent version-range CVE-2021-44228
manus-agent version-range CVE-2021-44228 --ecosystem pypi
manus-agent version-range CVE-2021-44228 --output json | jq .first_patched_version

Design

  • Zero new dependencies — uses only requests (already a project dep)
  • Retry/back-off on all HTTP (configurable via env vars, same pattern as other tools)
  • NVD_API_KEY support for higher rate limits
  • Graceful degradation — NVD or OSV failure returns partial results, never crashes
  • Strands TOOL_SPEC interface — compatible with the agent tool registry
  • Ecosystem normalisation — accepts aliases (e.g., pythonPyPI, nodenpm)
  • GHSA alias following — when CVE record lacks package data, follows GHSA aliases

Test Coverage

99 fully-mocked tests covering:

  • TOOL_SPEC contract (5)
  • Input validation (6)
  • CPE URI parsing (6)
  • Range string building (9)
  • CPE range extraction (7)
  • Ecosystem normalisation (8)
  • Ecosystem filtering (6)
  • NVD headers (3)
  • HTTP retry behaviour (5)
  • OSV range extraction (7)
  • NVD fetch (4)
  • Core fetch_version_range (7)
  • Text formatting (5)
  • Strands handler (5)
  • CLI subcommand (6)
  • Edge cases (7)
  • JSON output (2)
  • Integration: graceful degradation (2)

Full suite: 1257 passed (baseline 1158 + 99 new), 0 failures.

Files Changed

  • src/manus_agent/tools/get_version_range.py (new — tool implementation)
  • src/manus_agent/cli.py (dispatch + parser + _SUBCOMMANDS registration)
  • tests/test_version_range.py (new — 99 tests)

Duplicate Check

Checked all 50 open PRs (#141#190) and 30 merged PRs. No existing PR covers NVD CPE + OSV.dev version range resolution as a dedicated tool. Related but distinct:

manus-use pushed a commit that referenced this pull request Jun 29, 2026
…n PRs roadmap, and changelog section

- poc-search subcommand (PR #62): multi-source PoC aggregator (trickest, VulnCheck KEV, Exploit-DB, GitHub, NVD)
- changelog subcommand (PR #66): conventional-commit release automation
- VulnCheck enrichment section: VULNCHECK_API_KEY optional, vulncheck-kev + nist-nvd2 indexes
- Updated 8-step VI pipeline description to include VulnCheck KEV in step 2, patch diff/exploit complexity/version range in step 6
- Coming Soon table: 9 open PRs (#51 silent-patches, #53 cve-timeline, #54 version-range, #58 vendor-response, #60 poc-freshness, #63 blast-radius, #64 sbom-scan, #65 temporal-priority, #67 cluster-variants)
- Updated built-in tools list to mention VulnCheck KEV and new VI tools
- Added Changelog section linking to CHANGELOG.md
- Updated Table of Contents with Changelog entry
- Expanded Security examples to include poc-search and changelog
@manus-use
manus-use force-pushed the feat/version-range branch from 93e789e to ef44783 Compare July 3, 2026 00:12
@manus-use manus-use changed the title feat(tools): affected-version range resolver (manus-use version-range) feat(tools): version range analyzer — get_version_range tool + manus-agent version-range CLI Jul 3, 2026
@manus-use manus-use changed the title feat(tools): version range analyzer — get_version_range tool + manus-agent version-range CLI feat(tools): get_version_range — NVD CPE + OSV.dev affected version resolver + CLI subcommand (+74 tests) Aug 12, 2026
@manus-use manus-use changed the title feat(tools): get_version_range — NVD CPE + OSV.dev affected version resolver + CLI subcommand (+74 tests) feat(tools): get_version_range — CVE affected version range resolver + CLI subcommand (+85 tests) Aug 15, 2026
@manus-use manus-use changed the title feat(tools): get_version_range — CVE affected version range resolver + CLI subcommand (+85 tests) feat(tools): get_version_range — NVD CPE + OSV.dev affected version range resolver + CLI subcommand (+99 tests) Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant